home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / pcboard / wall15.zip / WALL.PPS < prev   
Text File  |  1996-11-23  |  42KB  |  1,180 lines

  1. ; ┌─────────────────────────────────────────────────────────────────────────┐
  2. ; │ The Wall v1.5 - Last Modified 11-23-96           The Digital Nebula BBS │
  3. ; │ By Jesse Keene                                   (408)469-3604          │
  4. ; └─────────────────────────────────────────────────────────────────────────┘
  5. ;
  6. ; Note: This PPE *Will Not Compile* without the "/disarr" parameter
  7. ;       ie, "pplc wall.pps /disarr", this is because it uses some
  8. ;       multi-dimensional arrays
  9. ;
  10. ;  If you find this PPE of any use, I would -=Really Appreciate=- hearing
  11. ;  from you!!!  You can email me via Internet at spacecb@deeptht.armory.com
  12.  
  13. DECLARE PROCEDURE Main()
  14. DECLARE PROCEDURE PrnWall(boolean ShowBG)
  15. DECLARE PROCEDURE PrnPos()
  16. DECLARE PROCEDURE PrnEndLine()
  17. DECLARE PROCEDURE LoadDAT()
  18. DECLARE PROCEDURE SaveDAT()
  19. DECLARE PROCEDURE SaveANS(string SavANSfilename)
  20. DECLARE PROCEDURE SavePCB(string SavPCBfilename)
  21. DECLARE PROCEDURE Send()
  22. DECLARE FUNCTION  Blink(byte iBG) BYTE
  23. DECLARE FUNCTION  Lock() BOOLEAN
  24. DECLARE FUNCTION  SwapBool(Boolean swp) BOOLEAN
  25. DECLARE FUNCTION  GetYN(string Prompt, boolean YN) BOOLEAN
  26. DECLARE FUNCTION  Direction(string Prompt) INT
  27.  
  28. int i, PosX,PosY,  OldX,OldY
  29. int wDAT, wASC, DirWordz
  30. byte CurClr, CurBG
  31. boolean prompt_flag, lock_flag, NumPad, G_Bye, BGon, BSon, LBon
  32. boolean Load_PCB, Load_ANS, Save_PCB, Save_ANS
  33. string cmdline, WallVer, TmpFile, LstUsrName, LstUsrAlias, nullstr, ESC
  34. string AnsiSave, AnsiRestore, AnsiClrLine
  35. string WallDat, WallAsc(22)
  36. redim  WallDat,22,2
  37.  
  38. WallVer="v1.5"
  39. TmpFile="$INUSE."
  40. CurClr=asc("7")
  41. CurBG =asc("0")
  42. prompt_flag=0 : lock_flag=0
  43. Load_PCB=0 : Load_ANS=0 : Save_PCB=0 : Save_ANS=0
  44. BGon=1 : LBon=1 : DirWordz=0
  45. NumPad=0
  46. ESC=chr(27)
  47. AnsiSave=   ESC+"[s"
  48. AnsiRestore=ESC+"[u"
  49. AnsiClrLine=ESC+"[K"
  50.  
  51. begin
  52. getuser
  53.  
  54. if (!exist(ppepath()+"WALL.BG")) then
  55.         println "WALL.BG is missing!!!"
  56.         end
  57. endif
  58.  
  59. cmdline = tokenstr()
  60. tokenize cmdline
  61. while (tokcount() > 0) do
  62.         cmdline = GetTOKEN()
  63.         if (upper(cmdline)="/PROMPT") prompt_flag=true
  64.         if (upper(cmdline)="/LOCK") lock_flag=true
  65.         if (upper(cmdline)="/LOADPCB") load_pcb=true
  66.         if (upper(cmdline)="/LOADANS") load_ans=true
  67.         if (upper(cmdline)="/SAVEPCB") save_pcb=true
  68.         if (upper(cmdline)="/SAVEANS") save_ans=true
  69.         if (upper(cmdline)="/BSON") BSon=true
  70.         if (upper(cmdline)="/BGOFF") BGon=false
  71.         if (upper(cmdline)="/LBOFF") LBon=false
  72. endwhile
  73.  
  74. if ( (!ansion()) & (!prompt_flag) ) then
  75.         println
  76.         println "ANSI not detected"
  77.         println
  78.         println "The Wall cannot function without the use of ANSI color & positioning codes"
  79.         println
  80.         println "You should go into your terminal settings, and look for a setting where"
  81.         println "you can enable ANSI mode."
  82.         println
  83.         println "If your using some garbage term program that doesn't even have ok ANSI support"
  84.         println "[Like Windows 3.x terminal! Yech!] Get a new one that does support it"
  85.         println
  86.         CmdLine="N"
  87.         InputText " Enter the Wall (y/N) _",CmdLine,@X07,1
  88.         if (!upper(CmdLine)="Y") end
  89.         CmdLine=""
  90. elseif ( (!ansion()) & prompt_flag) then
  91.         end
  92. endif
  93.  
  94. GrafMode 2 ' Force ANSI Color
  95.  
  96. print ESC+"[0;1;5;37;47m@X00@X07"
  97.  
  98. if (Lock()) then
  99.         if (!prompt_flag) then
  100.                 freshline
  101.                 print "@X07The Wall is in use on another node, exiting"
  102.         endif
  103.         end
  104. endif
  105.  
  106. if (prompt_flag) then
  107.         if (!GetYN("@X03Do you want to Tag on the Graffitti Wall",0)) then
  108.                 if (Lock_Flag) delete ppepath()+TmpFile+string(pcbnode())
  109.                 end
  110.         endif
  111. endif
  112.  
  113. print "@POFF@@QOFF@"
  114.  
  115. if (!exist(ppepath()+"WALL.BG")) then
  116.         println "WALL.BG is missing!!!"
  117.         end
  118. endif
  119.  
  120. LoadDAT()
  121.  
  122. cls
  123.  
  124. log "User Entered The Wall",0
  125.  
  126. Main()
  127.  
  128. SaveDAT()
  129.  
  130. if (Load_PCB | Save_PCB) SavePCB("")
  131. if (Load_ANS | Save_ANS) SaveANS("")
  132.  
  133. fcloseall
  134. if (Lock_Flag) delete ppepath()+TmpFile+string(pcbnode())
  135. if (G_Bye) hangup
  136. cls
  137.  
  138. END
  139.  
  140. PROCEDURE Main()
  141. boolean Main_Loop, Time_Loop, Input_Flag, BG_Stat, DispClrFlag
  142. boolean Ctrl_A, Ctrl_B, Ctrl_C, Ctrl_D, Ctrl_N, Ctrl_O, Ctrl_Q, Ctrl_R, Ctrl_T, Ctrl_Z
  143. string KeyBuf, CmdStr, DirWnlb
  144. byte LastClr, LastBGClr
  145. int Result, RandC(1), LstSec
  146. integer YoyoCount : boolean YoyoBool
  147.  
  148. Main_Loop=1 : DispClrFlag=1
  149.  
  150. if (Load_ANS) then
  151.         cls
  152.         if (BGon) dispstr "%"+ppepath()+"WALL.BG"
  153.         dispstr "%"+ppepath()+"WALL.ANS"
  154. elseif (Load_PCB) then
  155.         cls
  156.         dispstr "%"+ppepath()+"WALL.PCB"
  157. else
  158.         PrnWall(BGon)
  159. endif
  160.  
  161. PrnEndLine()
  162.  
  163. PosX=2 : PosY=2
  164. Main_Loop=1
  165. PrnPos()
  166. while (Main_Loop) do
  167.         KeyBuf=INKEY()
  168.  
  169.       ; Yoyopro Protection!!
  170.         if (upper(KeyBuf)="Y") then
  171.                 if (YoyoBool=0) inc YoyoCount
  172.                 YoyoBool=1
  173.         elseif (upper(KeyBuf)="O") then
  174.                 if (YoyoBool=1) inc YoyoCount
  175.                 YoyoBool=0
  176.         endif
  177.  
  178.       ; Type "yoyo" too much and the Fedz'll bust ya
  179.         if (YoyoCount > 80) then
  180.                 cls
  181.                 println "Federal Law Prohibits Yoyoing in CyberSpace"
  182.                 log "Yoyoing Violation",1
  183.                 wait
  184.                 if (Lock_Flag) delete ppepath()+TmpFile+string(pcbnode())
  185.                 hangup
  186.                 end
  187.         endif
  188.  
  189.       ' Takes care of a problem with PCBoard's internal ^X/^K [Abort Output]
  190.       ' and redraws the screen
  191.         if (abort()) then
  192.                 BG_Stat=1
  193.                 resetdisp
  194.                 cls
  195.                 PrnWall(BGon)
  196.                 PrnEndLine() : PrnPos()
  197.         endif
  198.  
  199.         select case (asc(KeyBuf))
  200.                 case 1:  Ctrl_A=1
  201.                 case 2:  Ctrl_B=1
  202.                 case 3:  Ctrl_C=1
  203.                 case 4:  Ctrl_D=1
  204.                 case 14: Ctrl_N=1
  205.                 case 15: Ctrl_O=1
  206.                 case 17: Ctrl_Q=1
  207.                 case 18: Ctrl_R=1
  208.                 case 20: Ctrl_T=1
  209.                 case 26: Ctrl_Z=1
  210.         end select
  211.  
  212.         if (Ctrl_O) then
  213.                 WallDat(PosY,0)=Left(WallDat(PosY,0),PosX-1)+chr(CurClr)+Right(WallDat(PosY,0),79-PosX)
  214.                 WallDat(PosY,2)=Left(WallDat(PosY,2),PosX-1)+chr(CurBG)+Right(WallDat(PosY,2),79-PosX)
  215.                 AnsiPos PosX,PosY
  216.                 if (!mid(WallDat(PosY,1),PosX,1)=chr(32)) print "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)+mid(WallDat(PosY,1),PosX,1)
  217.  
  218.                 select case (DirWordz)
  219.                         case 0: inc PosX
  220.                         case 1: dec PosX
  221.                         case 2: inc PosY
  222.                         case 3: dec PosY
  223.                         case 4: inc PosX : inc PosY
  224.                         case 5: inc PosX : dec PosY
  225.                        default: DirWordz=0
  226.                 end select
  227.  
  228.                 if (PosX > 79) PosX=1
  229.                 if (PosX < 1)  PosX=79
  230.                 if (PosY > 22) PosY=1
  231.                 if (PosY < 1)  PosY=22
  232.                 PrnPos()
  233.         Ctrl_O=0
  234.         endif
  235.  
  236.         if (Ctrl_Z) then
  237.                 cls
  238.  
  239.               ; Don't change or remove my copyright message, or my BBS ad!
  240.               ; If you do I'll Sue You for Copyright Infringment!!!
  241.  
  242.                 println "@X0EHelp@X06: @X4F The Wall "+WallVer+" - PCBoard PPE @POS:56@Digital Nebula (c) 1996 @X07"
  243.                 dispstr "%"+ppepath()+"hlpwall"
  244.                 print "@X4F The Wall @X1E from the Digital Nebula BBS [408]469-3604 @X07_"
  245.                 nullstr=tinkey(0)
  246.                 PrnWall(BGon)
  247.                 PrnEndLine() : PrnPos()
  248.         Ctrl_Z=0
  249.         endif
  250.  
  251.         if (Ctrl_D) then
  252.                 AnsiPos 1,23 : print AnsiClrLine
  253.                 if (LBon) then
  254.                         DirWordz=Direction("@X0B Select Direction@X03: @X07")
  255.                 else
  256.                         DirWnlb="F"
  257.                         INPUTSTR "@X0BSelect Dir@X03: @X03(@X0BF@X03)orward, (@X0BB@X03)ackward, (@X0BD@X03)own, (@X0BU@X03)p, (@X0BI@X03) Diagnal, (@X0BA@X03) Diag-Up", DirWnlb, 0Fh, 1, "fbudiaFBUDIA", FIELDLEN + GUIDE + UPCASE + ERASELINE
  258.                         if (upper(DirWnlb="F")) DirWordz=0
  259.                         if (upper(DirWnlb="B")) DirWordz=1
  260.                         if (upper(DirWnlb="D")) DirWordz=2
  261.                         if (upper(DirWnlb="U")) DirWordz=3
  262.                         if (upper(DirWnlb="I")) DirWordz=4
  263.                         if (upper(DirWnlb="A")) DirWordz=5
  264.                 endif
  265.                 PrnEndLine() : PrnPos()
  266.         Ctrl_D=0
  267.         endif
  268.  
  269.         if (Ctrl_A) then
  270.                 Ctrl_A=0
  271.                 CmdStr=""
  272.                 AnsiPos 1,23 : print "@X07",AnsiClrLine
  273.                 if (NumPad) then : nullstr="ON"
  274.                             else : nullstr="OFF"
  275.                 endif
  276.                 AnsiPos 62,23 : print "@X03(@X0BN@X03)umber Pad: @X0F"+nullstr : nullstr=""
  277.                 AnsiPos 1,23  : InputText "@X03(@X0BQ@X03)uit, (@X0BH@X03)elp, Command? _",CmdStr,@X07,12
  278.                 let CmdStr=upper(CmdStr)
  279.  
  280.                 if (CmdStr="B") Ctrl_B=TRUE
  281.                 if (CmdStr="C") then
  282.                         Ctrl_C=TRUE
  283.                         Loop
  284.                 endif
  285.                 if (CmdStr="D") then
  286.                         Ctrl_D=TRUE
  287.                         Loop
  288.                 endif
  289.                 if (CmdStr="H" | CmdStr="HELP" | CmdStr="?" | CmdStr="Z") then
  290.                         Ctrl_Z=TRUE
  291.                         Loop
  292.                 endif
  293.                 if (CmdStr="N") then
  294.                         Ctrl_N=TRUE
  295.                         Loop
  296.                 endif
  297.                 if (CmdStr="O") Ctrl_O=TRUE
  298.                 if (CmdStr="Q" | CmdStr="S") then
  299.                         Main_Loop=0
  300.                         Loop
  301.                 endif
  302.                 if (CmdStr="A") then
  303.                         AnsiPos 1,23 : print "@X07",AnsiClrLine
  304.                         if (GetYN("@X0E Abort Changes",1)) then
  305.                                 LoadDAT()
  306.                                 PrnWall(BGon)
  307.                         endif
  308.                 endif
  309.                 if (CmdStr="R") Ctrl_R=TRUE
  310.                 if (CmdStr="T") Ctrl_T=TRUE
  311.                 if (CmdStr="G" | CmdStr="BYE") then
  312.                         log "User Logged off thru Wall PPE",0
  313.                         AnsiPos 1,23 : print "@X07",AnsiClrLine
  314.                         G_Bye=1
  315.                         Main_Loop=0
  316.                         Loop
  317.                 endif
  318.  
  319.                 if (CmdStr="SEND") Send()
  320.  
  321.                 if (CmdStr="SAVE") SaveDAT()
  322.                 if (CmdStr="SAVEPCB") SavePCB("")
  323.                 if (CmdStr="SAVEANS") SaveANS("")
  324.                 if (CmdStr="VIEWPCB") then
  325.                         if (exist(ppepath()+"WALL.PCB")) then
  326.                                 cls
  327.                                 dispstr "%"+ppepath()+"WALL.PCB"
  328.                                 AnsiPos 1,23 : print "@X07",AnsiClrLine
  329.                                 print "@X0B View of WALL.PCB ... @X0FPress Any Key to Return"
  330.                                 nullstr=tinkey(0)
  331.                                 PrnWall(BGon)
  332.                         else
  333.                                 AnsiPos 1,23 : print "@X07",AnsiClrLine
  334.                                 print "@X0F WALL.PCB @X0ENot Found!!! @X07"
  335.                                 nullstr=tinkey(100)
  336.                         endif
  337.                 endif
  338.                 if (CmdStr="VIEWANS") then
  339.                         if (exist(ppepath()+"WALL.ANS")) then
  340.                                 cls
  341.                                 if (BGon) dispstr "%"+ppepath()+"WALL.BG"
  342.                                 dispstr "%"+ppepath()+"WALL.ANS"
  343.                                 AnsiPos 1,23 : print "@X07",AnsiClrLine
  344.                                 print "@X0B View of WALL.ANS ... @X0FPress Any Key@X07"
  345.                                 nullstr=tinkey(0)
  346.                                 PrnWall(BGon)
  347.                         else
  348.                                 AnsiPos 1,23 : print "@X07",AnsiClrLine
  349.                                 print "@X0F WALL.ANS @X0ENot Found!!! @X07"
  350.                                 nullstr=tinkey(100)
  351.                         endif
  352.                 endif
  353.  
  354.                 if (CmdStr="BGON") then
  355.                         BGon=TRUE
  356.                         PrnWall(1)
  357.                 endif
  358.                 if (CmdStr="BGOFF") then
  359.                         BGon=FALSE
  360.                         PrnWall(0)
  361.                 endif
  362.                 if (CmdStr="BSON")  BSon=TRUE
  363.                 if (CmdStr="BSOFF") BSon=FALSE
  364.  
  365.                 if (CmdStr="LBON")  LBon=TRUE
  366.                 if (CmdStr="LBOFF") LBon=FALSE
  367.  
  368.                 if (CmdStr="VER") then
  369.                         AnsiPos 1,23 : print AnsiClrLine
  370.                         print "@X0C The Wall @X0F"+WallVer+"@X07 (c) 1996 by Jesse Keene"
  371.                         nullstr=tinkey(200)
  372.                 endif
  373.  
  374.                 if (CmdStr="JANITOR") then
  375.                         for i = 1 to 22
  376.                                 WallDat(i,1)=space(79)
  377.                                 WallDat(i,0)=replace(space(79)," ","7")
  378.                                 WallDat(i,2)=replace(space(79)," ","0")
  379.                         endfor
  380.                         PrnWall(BGon)
  381.                 endif
  382.  
  383.                 if (CmdStr="RANDC" | CmdStr="RC") then
  384.                         :RandAgin
  385.                         RandC(0)=random(15)
  386.                         RandC(1)=random(15)
  387.  
  388.                         if (RandC(1) < 8) then
  389.                                 if (RandC(0)=RandC(1) | (RandC(0)-8)=RandC(1)) goto RandAgin
  390.                         endif
  391.  
  392.                         if (RandC(0) >= 10) CurBG= RandC(0)+55
  393.                         if (RandC(1) >= 10) CurClr=RandC(1)+55
  394.  
  395.                         if (RandC(0) < 10) CurBG= RandC(0)+48
  396.                         if (RandC(1) < 10) CurClr=RandC(1)+48
  397.                 endif
  398.  
  399.                 if (CmdStr="RANDP" | CmdStr="RP") then
  400.                         PosX=1+random(78)
  401.                         PosY=1+random(21)
  402.                 endif
  403.  
  404.                 if (CmdStr="LASTIN") then
  405.                         AnsiPos 1,23 : print AnsiClrLine
  406.                         print " @X0FName:@X07 "+mixed(LstUsrName)
  407.                         if (PSA(1) & (!LstUsrAlias="")) print " @X0FAlias:@X07 "+mixed(LstUsrAlias)
  408.                         nullstr=tinkey(200)
  409.                 endif
  410.  
  411.                 if (!upper(CmdStr)=StripStr(upper(CmdStr),"FUCK") | \
  412.                     !upper(CmdStr)=StripStr(upper(CmdStr),"SHIT") ) then
  413.                         AnsiPos 1,23 : print AnsiClrLine
  414.                         let i=random(6)
  415.                         select case (i)
  416.                                 case 0: print "@X0E Talk Nasty To Me, Baby!! "
  417.                                 case 1: print "@X0F What do you think this is, a bathroom wall?! "
  418.                                 case 2: print "@X0C You @X86Stink!!!@X07 "
  419.                                 case 3: print "@X0E You Smell Like @X8EPiss@X0E! "
  420.                                 case 4: print "@X07 Yeah, cussing is permitted on the wall, so what's your point?! "
  421.                                 case 5: print "@X8F Error:@X0F Dumbass at Keyboard "
  422.                                 case 6: print "@X0A Huh huh-huh huh Huh-huh huh Huh-huh huh, YOU SUCK! BUNGHOLE!@X07 "
  423.                         end select
  424.                         nullstr=tinkey(100)
  425.                 endif
  426.  
  427.                 if (CmdStr="TIME" | CmdStr="CLOCK") then
  428.                         AnsiPos 1,23 : print AnsiClrLine
  429.                         Time_Loop=1
  430.                         while (Time_Loop) do
  431.                                 if (!LstSec=SEC(TIME())) then
  432.                                         AnsiPos 1,23
  433.                                         print "@X"+chr(CurBG)+chr(CurClr)+" ",TimeAP(TIME())," @X07"
  434.                                         let LstSec=SEC(TIME())
  435.                                 endif
  436.                                 if ( asc(INKEY()) > 0 ) Time_Loop=0
  437.                         endwhile
  438.                 endif
  439.  
  440.                 if (CmdStr="DATE") then
  441.                         AnsiPos 1,23
  442.                         print AnsiClrLine,"@X"+chr(CurBG)+chr(CurClr)+" ",DATE()," @X07"
  443.                         nullstr=tinkey(100)
  444.                 endif
  445.  
  446.                 if (CmdStr="IDKFA" | CmdStr="DNSTUFF") then
  447.                         AnsiPos 1,23 : print AnsiClrLine
  448.                         print "@X0C Very Happy Ammo Added @X07"
  449.                         nullstr=tinkey(100)
  450.                 endif
  451.  
  452.                 if (CmdStr="EXIT") then
  453.                         AnsiPos 1,23 : print AnsiClrLine
  454.                         if (!GetYN("@X0E Save Changes Before Exiting",1)) then
  455.                                 if (Lock_Flag) delete ppepath()+TmpFile+string(pcbnode())
  456.                                 end
  457.                         endif
  458.                         Main_Loop=0
  459.                         Loop
  460.                 endif
  461.  
  462.                 PrnEndLine() : PrnPos()
  463.         Ctrl_A=0
  464.         endif
  465.  
  466.         if (Ctrl_B) then
  467.                 CurBG=Blink(CurBG)
  468.  
  469.                 if (DirWordz=0) then : AnsiPos 32,23
  470.                                 else : AnsiPos 75,23
  471.                 endif
  472.  
  473.                 print "@X"+chr(CurBG)+chr(CurClr)+"Color@X07"
  474.                 AnsiPos PosX,PosY
  475.         Ctrl_B=0
  476.         endif
  477.  
  478.         if (Ctrl_T) then
  479.                 if (!mid(WallDat(PosY,1),PosX,1)=" ") then
  480.                         CurClr=asc(mid(WallDat(PosY,0),PosX,1))
  481.                         CurBG= asc(mid(WallDat(PosY,2),PosX,1))
  482.                         if (DirWordz=0) then : AnsiPos 32,23
  483.                                         else : AnsiPos 75,23
  484.                         endif
  485.  
  486.                         print "@X"+chr(CurBG)+chr(CurClr)+"Color@X07"
  487.                         AnsiPos PosX,PosY
  488.                 endif
  489.         Ctrl_T=0
  490.         endif
  491.  
  492.         if (Ctrl_C) then
  493.  
  494.                 CurBG=asc("0")
  495.                 DispClrFlag=1
  496.                 AnsiPos 1,23
  497.                 print AnsiClrLine+"@X03 Select Color: "+AnsiSave
  498.                 AnsiPos 32,23
  499.                 print "@X09[@X0BCtrl@X03^@X0BB@X09]@X03 Change Background Color@X07"
  500.  
  501.                 while (Input_Flag=0) do
  502.                         KeyBuf=upper(INKEY())
  503.                         if (len(KeyBuf) > 1) KeyBuf=""
  504.                         if (KeyBuf=ESC) then
  505.                                 Input_Flag=1
  506.                                 CurClr=asc("7") : CurBG=asc("0")
  507.                                 PrnEndLine() : PrnPos()
  508.                         endif
  509.  
  510.                         if (DispClrFlag) then
  511.                                 print AnsiRestore
  512.                                 for i = 0 to 9
  513.                                         if (!string(i)=chr(CurBG)) print "@X"+chr(CurBG)+string(i)+string(i)
  514.                                 endfor
  515.                                 for i = 1 to 6
  516.                                         print "@X"+chr(CurBG)+chr(64+i)+chr(64+i)
  517.                                 endfor
  518.                                 DispClrFlag=0
  519.                         endif
  520.  
  521.                         if (asc(KeyBuf)=2) then
  522.                                 if (CurBG >= asc("7")) then
  523.                                         CurBG=asc("0")
  524.                                 else
  525.                                         CurBG=CurBG+1
  526.                                 endif
  527.                                 DispClrFlag=1
  528.                         endif
  529.  
  530.                         ' asc 48-57 = "0-9", asc 65-70 = "A-F"
  531.                         if ((asc(KeyBuf) >= 48 & asc(KeyBuf) <= 57) | \
  532.                             (asc(KeyBuf) >= 65 & asc(KeyBuf) <= 70)) then
  533.                                 if (asc(KeyBuf)=CurBG) goto AbortInput
  534.                                 Input_Flag=TRUE
  535.                                 CurClr=asc(KeyBuf)
  536.                                 PrnEndLine() : PrnPos()
  537.                                 :AbortInput
  538.                         endif
  539.                 endwhile
  540.  
  541.                 KeyBuf=""
  542.                 Input_Flag=0
  543.                 AnsiPos PosX,PosY
  544.         Ctrl_C=0
  545.         endif
  546.  
  547.         if (Ctrl_N) then
  548.                 NumPad=SwapBool(NumPad)
  549.  
  550.                         AnsiPos 1,23 : print AnsiClrLine
  551.                         if (NumPad=1) print "@X03 Number keys are now interpreted for cursor movement, @X0BTURN ON YOUR @X0FNUMLOCK@X07"
  552.                         if (NumPad=0) print "@X03 Number keys will now get typed on The Wall, PC Arrow keys should still work@X07"
  553.                         nullstr=tinkey(200)
  554.  
  555.                 PrnEndLine() : PrnPos()
  556.         Ctrl_N=0
  557.         endif
  558.  
  559.         if (Ctrl_R) then
  560.                 PrnWall(BGon)
  561.                 PrnEndLine() : PrnPos()
  562.         Ctrl_R=0
  563.         endif
  564.  
  565.         if (KeyBuf="RIGHT" | (NumPad=1 & KeyBuf="6")) then
  566.                 inc PosX : if (PosX > 79) PosX = 1
  567.                 PrnPos()
  568.         endif
  569.  
  570.         if (KeyBuf="LEFT"  | (NumPad=1 & KeyBuf="4")) then
  571.                 dec PosX : if (PosX < 1)  PosX = 79
  572.                 PrnPos()
  573.         endif
  574.  
  575.         if (KeyBuf="DEL" | KeyBuf="" | asc(KeyBuf)=8) then
  576.                 OldX=PosX : OldY=PosY
  577.                 select case (DirWordz)
  578.                         case 0: dec PosX
  579.                         case 1: inc PosX
  580.                         case 2: dec PosY
  581.                         case 3: inc PosY
  582.                         case 4: dec PosX : dec PosY
  583.                         case 5: dec PosX : inc PosY
  584.                        default: DirWordz=0
  585.                 end select
  586.  
  587.                 if (PosX > 79) PosX=1
  588.                 if (PosX < 1)  PosX=79
  589.                 if (PosY > 22) PosY=1
  590.                 if (PosY < 1)  PosY=22
  591.  
  592.                 if ((BSon & asc(KeyBuf)=8) | KeyBuf="DEL" | KeyBuf="") then
  593.                         WallDat(PosY,1)=Left(WallDat(PosY,1),PosX-1)+chr(32)+Right(WallDat(PosY,1),79-PosX)
  594.                         AnsiPos PosX,PosY
  595.                         if (BGon) then
  596.                                 print "@X04"+mid(StripATX(WallAsc(PosY)),PosX,1)
  597.                         else
  598.                                 print " "
  599.                         endif
  600.                 endif
  601.  
  602.                 PrnPos()
  603.         endif
  604.  
  605.         if (KeyBuf="DOWN"  | (NumPad=1 & KeyBuf="2")) then
  606.                 inc PosY : if (PosY > 22) PosY = 1
  607.                 PrnPos()
  608.         endif
  609.         if (KeyBuf="UP"    | (NumPad=1 & KeyBuf="8")) then
  610.                 dec PosY : if (PosY < 1)  PosY = 22
  611.                 PrnPos()
  612.         endif
  613.         if (KeyBuf="HOME") then
  614.                 PosX = 1  : PrnPos()
  615.         endif
  616.         if (KeyBuf="END") then
  617.                 PosX = 79 : PrnPos()
  618.         endif
  619.  
  620.         if (NumPad=1 & KeyBuf="7") then
  621.                 dec PosY : if (PosY < 1)  PosY = 22
  622.                 dec PosX : if (PosX < 1)  PosX = 79
  623.                 PrnPos()                                
  624.         endif
  625.         if (NumPad=1 & KeyBuf="9") then
  626.                 dec PosY : if (PosY < 1)  PosY = 22
  627.                 inc PosX : if (PosX > 79) PosX = 1
  628.                 PrnPos()
  629.         endif
  630.         if (NumPad=1 & KeyBuf="1") then
  631.                 inc PosY : if (PosY > 22) PosY = 1
  632.                 dec PosX : if (PosX < 1)  PosX = 79
  633.                 PrnPos()
  634.         endif
  635.         if (NumPad=1 & KeyBuf="3") then
  636.                 inc PosY : if (PosY > 22) PosY = 1
  637.                 inc PosX : if (PosX > 79) PosX = 1
  638.                 PrnPos()
  639.         endif
  640.         if (asc(KeyBuf)=13) then
  641.                 inc PosY : if (PosY > 22) PosY = 1
  642.                 PosX = 1
  643.                 PrnPos()
  644.         endif
  645.  
  646.         if (asc(KeyBuf) >= 32 | asc(KeyBuf)=9) then
  647.                 if (NumPad=1 & (asc(KeyBuf) >= 48 & asc(KeyBuf) <= 57)) goto AbortKey
  648.                 if (len(KeyBuf) > 1 | KeyBuf="") goto AbortKey
  649.                 WallDat(PosY,1)=Left(WallDat(PosY,1),PosX-1)+KeyBuf+Right(WallDat(PosY,1),79-PosX)
  650.                 WallDat(PosY,0)=Left(WallDat(PosY,0),PosX-1)+chr(CurClr)+Right(WallDat(PosY,0),79-PosX)
  651.                 WallDat(PosY,2)=Left(WallDat(PosY,2),PosX-1)+chr(CurBG)+Right(WallDat(PosY,2),79-PosX)
  652.                 AnsiPos PosX, PosY
  653.                 if ((!KeyBuf=" ") & (!asc(KeyBuf)=9)) then
  654.                         print "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)+KeyBuf
  655.                 elseif (KeyBuf=" ") then
  656.                         if (BGon) then
  657.                                 print "@X04"+mid(StripATX(WallAsc(PosY)),PosX,1)
  658.                         else
  659.                                 print " "
  660.                         endif
  661.                 elseif (asc(KeyBuf)=9) then
  662.                         WallDat(PosY,1)=Left(WallDat(PosY,1),PosX-1)+chr(255)+Right(WallDat(PosY,1),79-PosX)
  663.                         print "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)+" "
  664.                 endif
  665.  
  666.                 select case (DirWordz)
  667.                         case 0: inc PosX
  668.                         case 1: dec PosX
  669.                         case 2: inc PosY
  670.                         case 3: dec PosY
  671.                         case 4: inc PosX : inc PosY
  672.                         case 5: inc PosX : dec PosY
  673.                        default: DirWordz=0
  674.                 end select
  675.  
  676.                 if (PosX > 79) PosX=1
  677.                 if (PosX < 1)  PosX=79
  678.                 if (PosY > 22) PosY=1
  679.                 if (PosY < 1)  PosY=22
  680.                 PrnPos()
  681.                 :AbortKey
  682.         endif
  683.  
  684.         if (Ctrl_Q) Main_Loop=0 ' User hit Ctrl_Q, Exit
  685.  
  686.         if (KeyBuf=ESC) then
  687.                 if (!DirWordz=0) then ' ESC to Turn off Direction (Ctrl^D)
  688.                         DirWordz=0
  689.                         PrnEndLine() : PrnPos()
  690.                 else
  691.                         Ctrl_A=TRUE ' ESC hit for Command
  692.                 endif
  693.         endif
  694. endwhile
  695.  
  696. endproc
  697.  
  698. PROCEDURE LoadDAT()
  699. if (!exist(ppepath()+"WALL.DAT")) then
  700.               wASC=FNEXT()
  701.         fopen wASC,ppepath()+"WALL.BG", O_RD, S_DB
  702.  
  703.         for i = 1 to 22
  704.                 WallDat(i,1)=space(79)
  705.                 WallDat(i,0)=replace(space(79)," ",chr(CurClr))
  706.                 WallDat(i,2)=replace(space(79)," ",chr(CurBG))
  707.                 fget wASC, WallAsc(i) : WallAsc(i)=StripATX(WallAsc(i))
  708.         endfor
  709. else
  710.  
  711.               wDAT=FNEXT()
  712.         fopen wDAT,ppepath()+"WALL.DAT", O_RD, S_DB
  713.               wASC=FNEXT()
  714.         fopen wASC,ppepath()+"WALL.BG", O_RD, S_DB
  715.  
  716.         for i = 1 to 22
  717.                 fget wDAT, WallDat(i,1)
  718.                 fget wASC, WallAsc(i)
  719.                 WallDat(i,1)=Left(WallDat(i,1),79)
  720.                 WallAsc(i)=StripAtx(WallAsc(i))
  721.         endfor
  722.         for i = 1 to 22
  723.                 fget wDAT, WallDat(i,0)
  724.                 fget wDAT, WallDat(i,2)
  725.         endfor
  726.                 fget wDAT, LstUsrName
  727.                 fget wDAT, LstUsrAlias
  728. endif
  729.  
  730. fclose wASC
  731. fclose wDAT
  732.  
  733. ENDPROC
  734.  
  735. PROCEDURE SaveDAT()
  736.         wDAT=FNEXT()
  737. fcreate wDAT,ppepath()+"WALL.DAT",O_WR,S_DB
  738.  
  739. for i = 1 to 22
  740.         fputln wDAT, Left(WallDat(i,1),79)
  741. endfor
  742. for i = 1 to 22
  743.         fputln wDAT, Left(WallDat(i,0),79)
  744.         fputln wDAT, Left(WallDat(i,2),79)
  745. endfor
  746. fputln wDAT, U_NAME()
  747. if (PSA(1)) fputln wDAT, U_ALIAS()
  748.  
  749. fclose wDAT
  750.  
  751. ENDPROC
  752.  
  753. PROCEDURE PrnWall(int ShowBG)
  754. byte LastClr, LastBGClr
  755. boolean BG_Stat
  756.  
  757. cls
  758. print "@POFF@" ' Disable pausing
  759. if (ShowBG=1) dispstr "%"+ppepath()+"WALL.BG"
  760. AnsiPos 1,1
  761.  
  762. OldX=PosX : OldY=PosY
  763.  
  764. PosY=0
  765. while (PosY < 22) do
  766.         inc PosY
  767.         PosX=0
  768.         while (PosX < 79) do
  769.                 inc PosX
  770.                 if (mid(WallDat(PosY,1),PosX,1)=" ") then
  771.                         BG_Stat=1
  772.                         if (TRIM(Right(WallDat(PosY,1),79-PosX)," ")="") break
  773.                         PosX=79-len(LTRIM(Right(WallDat(PosY,1),79-PosX)," "))
  774.                 else
  775.                         if (!chr(LastClr)=mid(WallDat(PosY,0),PosX,1) | (!chr(LastBGClr)=mid(WallDat(PosY,2),PosX,1)) | BG_Stat=1) then
  776.                                 if (BG_Stat=1) ansipos PosX,PosY
  777.                                 print "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)
  778.                                 LastClr  =asc(mid(WallDat(PosY,0),PosX,1))
  779.                                 LastBGClr=asc(mid(WallDat(PosY,2),PosX,1))
  780.                         endif
  781.                         if (asc(mid(WallDat(PosY,1),PosX,1))=255) then
  782.                                 print " "
  783.                         else
  784.                                 print mid(WallDat(PosY,1),PosX,1)
  785.                         endif
  786.                         BG_Stat=0
  787.                         if (PosX >= 79) BG_Stat=1
  788.                 endif
  789.         endwhile
  790. endwhile
  791.  
  792. PosX=OldX : PosY=OldY
  793.  
  794. endproc
  795.  
  796. PROCEDURE PrnPos()
  797.  
  798. AnsiPos 1,23 : print ESC+"[0m"
  799. if (PosY < 10) print "@POS:2@"
  800. print PosY,",@POS:4@",PosX," "
  801. AnsiPos PosX,PosY
  802.  
  803. endproc
  804.  
  805. PROCEDURE PrnEndLine()
  806. string DirWord
  807.  
  808. AnsiPos 1,23 : print "@X07"+AnsiClrLine
  809.  
  810. if (DirWordz=0) then
  811.         if (NumPad=TRUE) then
  812.                 AnsiPos 7,23 : print "@X02Use Number Pad"
  813.         else
  814.                 AnsiPos 7,23 : print "@X02Use Arrow Keys"
  815.         endif
  816.  
  817.         AnsiPos 23,23 : print "@X09[@X0BCtrl@X03^@X0BC@X09] @X"+chr(CurBG)+chr(CurClr)+"Color"
  818.         AnsiPos 39,23 : print "@X09[@X03^@X0BB@X09]@X07 Blink"
  819.         AnsiPos 51,23 : print "@X09[@X03^@X0BZ@X09]@X07 Help"
  820.         AnsiPos 62,23 : print "@X09[@X0FCtrl@X03^@X0FQ@X09]@X03 to Quit@X07"
  821. else
  822.         select case (DirWordz)
  823.                 case 1: DirWord="backwards"
  824.                 case 2: DirWord="downwards"
  825.                 case 3: DirWord="upwards"
  826.                 case 4: DirWord="diagnally"
  827.                 case 5: DirWord="diagnally-up"
  828.         end select
  829.         AnsiPos 1,23 : print "@X07"
  830.         print AnsiClrLine+"@POS:7@@X03 Everything will get typed "+DirWord+" ... ESC to return to normal","@POS:75@@X"+chr(CurBG)+chr(CurClr)+"Color"
  831. endif
  832.  
  833. endproc
  834.  
  835. FUNCTION Blink(byte iBG) BYTE
  836.  
  837.                 if (iBG=asc("0")) Blink=asc("8")
  838.                 if (iBG=asc("1")) Blink=asc("9")
  839.                 if (iBG=asc("2")) Blink=asc("A")
  840.                 if (iBG=asc("3")) Blink=asc("B")
  841.                 if (iBG=asc("4")) Blink=asc("C")
  842.                 if (iBG=asc("5")) Blink=asc("D")
  843.                 if (iBG=asc("6")) Blink=asc("E")
  844.                 if (iBG=asc("7")) Blink=asc("F")
  845.  
  846.                 if (iBG=asc("8")) Blink=asc("0")
  847.                 if (iBG=asc("9")) Blink=asc("1")
  848.                 if (iBG=asc("A")) Blink=asc("2")
  849.                 if (iBG=asc("B")) Blink=asc("3")
  850.                 if (iBG=asc("C")) Blink=asc("4")
  851.                 if (iBG=asc("D")) Blink=asc("5")
  852.                 if (iBG=asc("E")) Blink=asc("6")
  853.                 if (iBG=asc("F")) Blink=asc("7")
  854.  
  855. ENDFUNC
  856.  
  857. FUNCTION Lock() BOOLEAN
  858. boolean L
  859. int ChanNum
  860.     ChanNum=FNEXT()
  861.  
  862. if (Lock_Flag) then
  863.         if (!findfirst(ppepath()+TmpFile+"*")="") then
  864.                 L=1
  865.         else
  866.                 FCREATE ChanNum, PPEPATH()+TmpFile+string(pcbnode()), O_WR, S_DW
  867.                 fclose  ChanNum
  868.                 L=0
  869.         endif
  870. else
  871.         L=0
  872. endif
  873.  
  874. Lock=L
  875.  
  876. ENDFUNC
  877.  
  878. FUNCTION GetYN(string Prompt, boolean YN) BOOLEAN
  879. string EndPrompt, KeyBuffer, YNnlb
  880. boolean LOOP_Flag, YNStat, DispFlag
  881.  
  882. if (!LBon) then
  883.         if (YN) then : YNnlb="Y"
  884.                 else : YNnlb="N"
  885.         endif
  886.         INPUTSTR Prompt, YNnlb, 0Fh, 1, "ynYN", FIELDLEN + GUIDE + UPCASE + ERASELINE
  887.         if (upper(YNnlb)="Y") GetYN=1
  888.         if (upper(YNnlb)="N") GetYN=0
  889.         goto eogyn
  890. endif
  891.  
  892. EndPrompt= "@X09[@X07Yes@X09] [@X07No@X09]@X07"
  893.  
  894. YNStat=YN
  895. DispFlag=1
  896. LOOP_Flag=1
  897. print Prompt
  898.  
  899. print "?@X07 ", AnsiSave, EndPrompt
  900.  
  901. while (LOOP_Flag) do
  902.         KeyBuffer = INKEY()
  903.  
  904.         if (upper(KeyBuffer)="Y") then
  905.                 YNStat=1
  906.                 DispFlag=1
  907.                 LOOP_Flag=0
  908.         elseif (upper(KeyBuffer)="N") then
  909.                 YNStat=0
  910.                 DispFlag=1
  911.                 LOOP_Flag=0
  912.         endif
  913.  
  914.         if (KeyBuffer="RIGHT" | KeyBuffer="LEFT" | KeyBuffer="4" | KeyBuffer="6" | asc(KeyBuffer)=32 | KeyBuffer="+" | KeyBuffer="-") then
  915.                 YNStat=SwapBool(YNStat)
  916.                 DispFlag=1
  917.         endif
  918.  
  919.                          ' 13 = Enter Key
  920.         if (asc(KeyBuffer)=13 | KeyBuffer=ESC) LOOP_Flag=0
  921.  
  922.         if (DispFlag) then
  923.                 if (YNStat) then
  924.                         print AnsiRestore
  925.                         forward 7
  926.                                 print "@X07No@X07"
  927.                         backup 8
  928.                                 print "@X1EYes@X07"
  929.                 else
  930.                         print AnsiRestore
  931.                         forward 1
  932.                                 print "@X07Yes@X07"
  933.                         forward 3
  934.                                 print "@X1ENo@X07"
  935.                 endif
  936.         endif
  937.  
  938.  DispFlag=0
  939. endwhile
  940. GetYN=YNStat
  941. :eogyn
  942. ENDFUNC
  943.  
  944. FUNCTION SwapBool(Boolean swp) BOOLEAN
  945.         if (swp=1) SwapBool=0
  946.         if (swp=0) SwapBool=1
  947. ENDFUNC
  948.  
  949. FUNCTION Direction(string Prompt) INT
  950. string EndPrompt, KeyBuffer
  951. string AnsiSave, AnsiRestore, TheWord(5)
  952. boolean LOOP_Flag
  953. int DirStat, TheSpot(5)
  954.  
  955. TheWord(0)="@X0FF@X07orward"    : TheSpot(0)=21
  956. TheWord(1)="@X0FB@X07ackward"   : TheSpot(1)=31
  957. TheWord(2)="@X0FD@X07own"       : TheSpot(2)=42
  958. TheWord(3)="@X0FU@X07p"         : TheSpot(3)=49
  959. TheWord(4)="@X07D@X0Fi@X07agnal"    : TheSpot(4)=54
  960. TheWord(5)="@X07Di@X0Fa@X07gnal-Up" : TheSpot(5)=64
  961.  
  962. EndPrompt= "@X09[@X0FF@X07orward@X09] [@X0FB@X07ackward@X09] [@X0FD@X07own@X09] [@X0FU@X07p@X09] [@X07D@X0Fi@X07agnal@X09] [@X07Di@X0Fa@X07gnal-Up@X09]@X07"
  963.  
  964. DirStat=0 : LOOP_Flag=1
  965. AnsiPos 1,23 : print Prompt : AnsiPos 20,23 : print EndPrompt
  966.  
  967. AnsiPos TheSpot(0),23
  968. print "@X1E"+StripATX(TheWord(0))+"@X07"
  969.  
  970. while (LOOP_Flag) do
  971.         KeyBuffer = INKEY()
  972.  
  973.         if     (upper(KeyBuffer)="F") then : DirStat=0 : LOOP_Flag=0
  974.         elseif (upper(KeyBuffer)="B") then : DirStat=1 : LOOP_Flag=0
  975.         elseif (upper(KeyBuffer)="D") then : DirStat=2 : LOOP_Flag=0
  976.         elseif (upper(KeyBuffer)="U") then : DirStat=3 : LOOP_Flag=0
  977.         elseif (upper(KeyBuffer)="I") then : DirStat=4 : LOOP_Flag=0
  978.         elseif (upper(KeyBuffer)="A") then : DirStat=5 : LOOP_Flag=0
  979.         endif
  980.                                                                              ' 8=Backspace
  981.         if (KeyBuffer="LEFT"  | KeyBuffer="4" | KeyBuffer="-" | asc(KeyBuffer)=8) then
  982.                 AnsiPos TheSpot(DirStat),23
  983.                 print   TheWord(DirStat)
  984.                 dec DirStat
  985.                 if (DirStat < 0) DirStat=5
  986.                 AnsiPos TheSpot(DirStat),23
  987.                 print "@X1E"+StripATX(TheWord(DirStat))+"@X07"
  988.         endif                                                                ' 32=Space
  989.         if (KeyBuffer="RIGHT" | KeyBuffer="6" | KeyBuffer="+" | asc(KeyBuffer)=32) then
  990.                 AnsiPos TheSpot(DirStat),23
  991.                 print   TheWord(DirStat)
  992.                 inc DirStat
  993.                 if (DirStat > 5) DirStat=0
  994.                 AnsiPos TheSpot(DirStat),23
  995.                 print "@X1E"+StripATX(TheWord(DirStat))+"@X07"
  996.         endif
  997.                          ' 13 = Enter Key
  998.         if (asc(KeyBuffer)=13 | KeyBuffer=ESC) then
  999.                 if (KeyBuffer=ESC) DirStat=0
  1000.                 Loop_Flag=0
  1001.         endif
  1002. endwhile
  1003.  
  1004. Direction=DirStat
  1005.  
  1006. endfunc
  1007.  
  1008. PROCEDURE SaveANS(string SavANSfilename)
  1009. byte LastClr, LastBGClr
  1010. boolean BG_Stat
  1011. int CurSavLine
  1012. int wANS
  1013.     wANS=FNEXT()
  1014.  
  1015. if (SavANSfilename="") SavANSfilename="WALL.ANS"
  1016.  
  1017. AnsiPos 1,23 : print AnsiClrLine,"@X07Saving "+SavANSfilename+" ... ",AnsiSave
  1018.  
  1019. fcreate wANS, ppepath()+SavANSfilename,O_WR,S_DB
  1020.  
  1021. OldX=PosX : OldY=PosY
  1022. CurSavLine=23
  1023.  
  1024. fput wANS, ESC+"[0;0H"
  1025.  
  1026. PosY=0
  1027. while (PosY < 22) do
  1028.         inc PosY
  1029.         PosX=0
  1030.         while (PosX < 79) do
  1031.                 inc PosX
  1032.                 if (mid(WallDat(PosY,1),PosX,1)=" ") then
  1033.                         BG_Stat=1
  1034.                         if (TRIM(Right(WallDat(PosY,1),79-PosX)," ")="") break
  1035.                         PosX=79-len(LTRIM(Right(WallDat(PosY,1),79-PosX)," "))
  1036.                 else
  1037.                         if (!chr(LastClr)=mid(WallDat(PosY,0),PosX,1) | (!chr(LastBGClr)=mid(WallDat(PosY,2),PosX,1)) | BG_Stat=1) then
  1038.                                 if (BG_Stat=1) fput wANS, ESC+"["+string(PosY)+";"+string(PosX)+"f"
  1039.                                 fput wANS, "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)
  1040.                                 LastClr  =asc(mid(WallDat(PosY,0),PosX,1))
  1041.                                 LastBGClr=asc(mid(WallDat(PosY,2),PosX,1))
  1042.                         endif
  1043.                         if (asc(mid(WallDat(PosY,1),PosX,1))=255) then
  1044.                                 fput wANS, " "
  1045.                         else
  1046.                                 fput wANS, mid(WallDat(PosY,1),PosX,1)
  1047.                         endif
  1048.                         BG_Stat=0
  1049.                         if (PosX >= 79) BG_Stat=1
  1050.                 endif
  1051.         endwhile
  1052.         print AnsiRestore,string(CurSavLine)," "
  1053.         dec CurSavLine
  1054.         fputln wANS, ""
  1055. endwhile
  1056.  
  1057. PosX=OldX : PosY=OldY
  1058.  
  1059. print AnsiRestore,"@X0FDone@X07"
  1060. nullstr=tinkey(9)
  1061.  
  1062. fclose wANS
  1063.  
  1064. endproc
  1065.  
  1066. PROCEDURE SavePCB(String SavPCBfilename)
  1067. byte LastClr, LastBGClr
  1068. boolean BG_Stat
  1069. int CurSavLine
  1070. int wPCB
  1071.  
  1072. if (SavPCBfilename="") SavPCBfilename="WALL.PCB"
  1073.  
  1074. AnsiPos 1,23 : print AnsiClrLine,"@X07Saving "+SavPCBfilename+" ... ",AnsiSave
  1075.  
  1076.         wPCB=FNEXT()
  1077. fcreate wPCB, ppepath()+SavPCBfilename,O_WR,S_DB
  1078.  
  1079. OldX=PosX : OldY=PosY
  1080. BG_Stat=1
  1081.  
  1082. fput wPCB, "@CLS@"
  1083.  
  1084. CurSavLine=23
  1085. PosY=0
  1086. while (PosY < 22) do
  1087.         inc PosY
  1088.         PosX=0
  1089.         fput wPCB, "@X04"
  1090.         while (PosX < 79) do
  1091.                 inc PosX
  1092.                 if (mid(WallDat(PosY,1),PosX,1)=" ") then
  1093.  
  1094.                         if (BG_Stat=0) fput wPCB, "@X04"
  1095.                         fput wPCB, mid(WallAsc(PosY),PosX,1)
  1096.                         BG_Stat=1
  1097.                 else
  1098.                         if (!chr(LastClr)=mid(WallDat(PosY,0),PosX,1) | (!chr(LastBGClr)=mid(WallDat(PosY,2),PosX,1)) | BG_Stat=1) then
  1099.                                 if (BG_Stat=1) then
  1100.                                 endif
  1101.                                 fput wPCB, "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)
  1102.                                 LastClr  =asc(mid(WallDat(PosY,0),PosX,1))
  1103.                                 LastBGClr=asc(mid(WallDat(PosY,2),PosX,1))
  1104.                         endif
  1105.  
  1106.                         if (asc(mid(WallDat(PosY,1),PosX,1))=255) then
  1107.                                 fput wPCB, " "
  1108.                         else
  1109.                                 fput wPCB, mid(WallDat(PosY,1),PosX,1)
  1110.                         endif
  1111.  
  1112.                         BG_Stat=0
  1113.                         if (PosX >= 79) BG_Stat=1
  1114.                 endif
  1115.         endwhile
  1116.         print AnsiRestore,string(CurSavLine)," "
  1117.         dec CurSavLine
  1118.         fputln wPCB, ""
  1119. endwhile
  1120.  
  1121. print AnsiRestore,"@X0FDone@X07"
  1122. nullstr=tinkey(9)
  1123.  
  1124. PosX=OldX : PosY=OldY
  1125.  
  1126. fclose wPCB
  1127.  
  1128. endproc
  1129.  
  1130. PROCEDURE Send()
  1131. string CmdStr,Sender
  1132. boolean RetRec,StS
  1133. int cn
  1134.         getuser
  1135.         if (U_Alias()="") then : Sender=mixed(U_NAME())
  1136.                           else : Sender=mixed(U_ALIAS())
  1137.         endif
  1138.  
  1139.         AnsiPos 1,23 : print "@X07",AnsiClrLine
  1140.         InputText "@X0E Send Wall (Blank=Send to Yourself): User",CmdStr,@X07,24
  1141.         let CmdStr=upper(trim(CmdStr," "))
  1142.         if (CmdStr="") then
  1143.                 CmdStr=U_NAME()
  1144.                 StS=1
  1145.         endif
  1146.         AnsiPos 1,23 : print "@X07",AnsiClrLine
  1147.  
  1148.         GetAltUser U_RECNUM(CmdStr)
  1149.  
  1150.         if (CurUser() < 0) then
  1151.                 print "@X0E "+CmdStr+": User Not Found!@X07 "
  1152.                 nullstr=tinkey(100)
  1153.         else
  1154.                         cn=FNEXT()
  1155.                 FCreate cn, ppepath()+"SEND.TMP", o_rw, s_dw
  1156.                         fputln cn, " Sender"+chr(58)+" "+Sender
  1157.                         fputln cn, ""
  1158.                         if (!StS) then
  1159.                                 fputln cn, " This was sent to you from inside The Wall "
  1160.                                 fputln cn, " Using the @X0BSEND@X07 command "
  1161.                         endif
  1162.                         fputln cn, "@WAIT@"
  1163.                 FClose  cn
  1164.  
  1165.                 SavePCB("WALL.SND")
  1166.                         
  1167.                 append PPEPATH()+"WALL.SND",PPEPATH()+"SEND.TMP"
  1168.                 delete PPEPATH()+"WALL.SND"
  1169.                 rename PPEPATH()+"SEND.TMP",PPEPATH()+"WALL.SND"
  1170.  
  1171.               ' message conf,to,from,sub,sec,pack,rr,echo,file
  1172.                 message 0,U_NAME(),"THE WALL","Send","R",0,0,0,ppepath()+"WALL.SND"
  1173.  
  1174.                 AnsiPos 1,23 : print "@X07",AnsiClrLine
  1175.                 print " Wall Send to "+mixed(U_NAME())
  1176.                 nullstr=tinkey(100)
  1177.         endif
  1178.         GetUser
  1179. ENDPROC
  1180.